package com.haha.myapplication;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.TextView;

public class score2 extends AppCompatActivity {

    private static final String TAG = "hh";
    int score1 = 0;
    int score2 = 0;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.week3score2);

    }

    public void clicka(View v) {
        Log.i(TAG, "clicka: aaaaaaaa");

        if (v.getId()==R.id.btn3){
            score1 += 3;
        }else if (v.getId()==R.id.btn2) {
            score1 += 2;
        }else if (v.getId()==R.id.btn1){
            score1++;
        }else {
            //reset
            score1 = 0;
            score2 = 0;
            TextView output = findViewById(R.id.score2);
            output.setText(String.valueOf(score2));
        }

        TextView output = findViewById(R.id.score1);
        output.setText(String.valueOf(score1));


    }
    public void clickb(View v) {
        Log.i(TAG, "clickb: aaaaaaaa");

        if (v.getId()==R.id.btnb3){
            score2 += 3;
        }else if (v.getId()==R.id.btnb2) {
            score2 += 2;
        }else if (v.getId()==R.id.btnb1){
            score2++;
        }else {
            //reset
            score2 = 0;
        }

        TextView output = findViewById(R.id.score2);
        output.setText(String.valueOf(score2));


    }
}